package com.wanshi.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanshi.enitiy.NetImg;
import com.wanshi.mapper.NetImgMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Created by IntelliJ IDEA.
 * @Author jzy
 * @Date 2021/11/24 18:57
 */
@Service
public class NetImgService {

    @Resource
    private NetImgMapper netImgMapper;

    public void save(NetImg netImg){
        netImgMapper.save(netImg);
    }

    public PageInfo findAllPage(int pageNum, int pageSize){
        PageHelper.startPage(pageNum, pageSize);
        List<NetImg> all = netImgMapper.findAll();
        PageInfo<NetImg> pageInfo = new PageInfo<NetImg>(all);
        return  pageInfo;
    }

    public NetImg findAllById(String id){
       return netImgMapper.findAllById(id);
    }
}
